home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / man / man.n / winfo.n < prev    next >
Text File  |  1995-07-21  |  14KB  |  449 lines

  1. '\"
  2. '\" Copyright (c) 1990 The Regents of the University of California.
  3. '\" All rights reserved.
  4. '\"
  5. '\" Permission is hereby granted, without written agreement and without
  6. '\" license or royalty fees, to use, copy, modify, and distribute this
  7. '\" documentation for any purpose, provided that the above copyright
  8. '\" notice and the following two paragraphs appear in all copies.
  9. '\"
  10. '\" IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
  11. '\" FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
  12. '\" ARISING OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
  13. '\" CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  14. '\"
  15. '\" THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
  16. '\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  17. '\" AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
  18. '\" ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  19. '\" PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  20. '\" 
  21. '\" $Header: /user6/ouster/wish/man/RCS/winfo.n,v 1.24 93/07/09 09:56:06 ouster Exp $ SPRITE (Berkeley)
  22. '/" 
  23. .\" The definitions below are for supplemental macros used in Tcl/Tk
  24. .\" manual entries.
  25. .\"
  26. .\" .HS name section [date [version]]
  27. .\"    Replacement for .TH in other man pages.  See below for valid
  28. .\"    section names.
  29. .\"
  30. .\" .AP type name in/out [indent]
  31. .\"    Start paragraph describing an argument to a library procedure.
  32. .\"    type is type of argument (int, etc.), in/out is either "in", "out",
  33. .\"    or "in/out" to describe whether procedure reads or modifies arg,
  34. .\"    and indent is equivalent to second arg of .IP (shouldn't ever be
  35. .\"    needed;  use .AS below instead)
  36. .\"
  37. .\" .AS [type [name]]
  38. .\"    Give maximum sizes of arguments for setting tab stops.  Type and
  39. .\"    name are examples of largest possible arguments that will be passed
  40. .\"    to .AP later.  If args are omitted, default tab stops are used.
  41. .\"
  42. .\" .BS
  43. .\"    Start box enclosure.  From here until next .BE, everything will be
  44. .\"    enclosed in one large box.
  45. .\"
  46. .\" .BE
  47. .\"    End of box enclosure.
  48. .\"
  49. .\" .VS
  50. .\"    Begin vertical sidebar, for use in marking newly-changed parts
  51. .\"    of man pages.
  52. .\"
  53. .\" .VE
  54. .\"    End of vertical sidebar.
  55. .\"
  56. .\" .DS
  57. .\"    Begin an indented unfilled display.
  58. .\"
  59. .\" .DE
  60. .\"    End of indented unfilled display.
  61. .\"
  62. '\"    # Heading for Tcl/Tk man pages
  63. .de HS
  64. .ds ^3 \\0
  65. .if !"\\$3"" .ds ^3 \\$3
  66. .if '\\$2'cmds'       .TH \\$1 1 \\*(^3 \\$4
  67. .if '\\$2'lib'        .TH \\$1 3 \\*(^3 \\$4
  68. .if '\\$2'tcl'        .TH \\$1 n \\*(^3 Tcl "Tcl Built-In Commands"
  69. .if '\\$2'tk'         .TH \\$1 n \\*(^3 Tk "Tk Commands"
  70. .if '\\$2'tclc'        .TH \\$1 3 \\*(^3 Tcl "Tcl Library Procedures"
  71. .if '\\$2'tkc'         .TH \\$1 3 \\*(^3 Tk "Tk Library Procedures"
  72. .if '\\$2'tclcmds'         .TH \\$1 1 \\*(^3 Tk "Tcl Applications"
  73. .if '\\$2'tkcmds'         .TH \\$1 1 \\*(^3 Tk "Tk Applications"
  74. .if t .wh -1.3i ^B
  75. .nr ^l \\n(.l
  76. .ad b
  77. ..
  78. '\"    # Start an argument description
  79. .de AP
  80. .ie !"\\$4"" .TP \\$4
  81. .el \{\
  82. .   ie !"\\$2"" .TP \\n()Cu
  83. .   el          .TP 15
  84. .\}
  85. .ie !"\\$3"" \{\
  86. .ta \\n()Au \\n()Bu
  87. \&\\$1    \\fI\\$2\\fP    (\\$3)
  88. .\".b
  89. .\}
  90. .el \{\
  91. .br
  92. .ie !"\\$2"" \{\
  93. \&\\$1    \\fI\\$2\\fP
  94. .\}
  95. .el \{\
  96. \&\\fI\\$1\\fP
  97. .\}
  98. .\}
  99. ..
  100. '\"    # define tabbing values for .AP
  101. .de AS
  102. .nr )A 10n
  103. .if !"\\$1"" .nr )A \\w'\\$1'u+3n
  104. .nr )B \\n()Au+15n
  105. .\"
  106. .if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n
  107. .nr )C \\n()Bu+\\w'(in/out)'u+2n
  108. ..
  109. '\"    # BS - start boxed text
  110. '\"    # ^y = starting y location
  111. '\"    # ^b = 1
  112. .de BS
  113. .br
  114. .mk ^y
  115. .nr ^b 1u
  116. .if n .nf
  117. .if n .ti 0
  118. .if n \l'\\n(.lu\(ul'
  119. .if n .fi
  120. ..
  121. '\"    # BE - end boxed text (draw box now)
  122. .de BE
  123. .nf
  124. .ti 0
  125. .mk ^t
  126. .ie n \l'\\n(^lu\(ul'
  127. .el \{\
  128. .\"    Draw four-sided box normally, but don't draw top of
  129. .\"    box if the box started on an earlier page.
  130. .ie !\\n(^b-1 \{\
  131. \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
  132. .\}
  133. .el \}\
  134. \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
  135. .\}
  136. .\}
  137. .fi
  138. .br
  139. .nr ^b 0
  140. ..
  141. '\"    # VS - start vertical sidebar
  142. '\"    # ^Y = starting y location
  143. '\"    # ^v = 1 (for troff;  for nroff this doesn't matter)
  144. .de VS
  145. .mk ^Y
  146. .ie n 'mc \s12\(br\s0
  147. .el .nr ^v 1u
  148. ..
  149. '\"    # VE - end of vertical sidebar
  150. .de VE
  151. .ie n 'mc
  152. .el \{\
  153. .ev 2
  154. .nf
  155. .ti 0
  156. .mk ^t
  157. \h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n'
  158. .sp -1
  159. .fi
  160. .ev
  161. .\}
  162. .nr ^v 0
  163. ..
  164. '\"    # Special macro to handle page bottom:  finish off current
  165. '\"    # box/sidebar if in box/sidebar mode, then invoked standard
  166. '\"    # page bottom macro.
  167. .de ^B
  168. .ev 2
  169. 'ti 0
  170. 'nf
  171. .mk ^t
  172. .if \\n(^b \{\
  173. .\"    Draw three-sided box if this is the box's first page,
  174. .\"    draw two sides but no top otherwise.
  175. .ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
  176. .el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
  177. .\}
  178. .if \\n(^v \{\
  179. .nr ^x \\n(^tu+1v-\\n(^Yu
  180. \kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c
  181. .\}
  182. .bp
  183. 'fi
  184. .ev
  185. .if \\n(^b \{\
  186. .mk ^y
  187. .nr ^b 2
  188. .\}
  189. .if \\n(^v \{\
  190. .mk ^Y
  191. .\}
  192. ..
  193. '\"    # DS - begin display
  194. .de DS
  195. .RS
  196. .nf
  197. .sp
  198. ..
  199. '\"    # DE - end display
  200. .de DE
  201. .fi
  202. .RE
  203. .sp .5
  204. ..
  205. .HS winfo tk
  206. .BS
  207. '\" Note:  do not modify the .SH NAME line immediately below!
  208. .SH NAME
  209. winfo \- Return window-related information
  210. .SH SYNOPSIS
  211. \fBwinfo\fR \fIoption \fR?\fIarg arg ...\fR?
  212. .BE
  213.  
  214. .SH DESCRIPTION
  215. .PP
  216. The \fBwinfo\fR command is used to retrieve information about windows
  217. managed by Tk.  It can take any of a number of different forms,
  218. depending on the \fIoption\fR argument.  The legal forms are:
  219. .TP
  220. \fBwinfo atom \fIname\fR
  221. .VS
  222. Returns a decimal string giving the integer identifier for the
  223. atom whose name is \fIname\fR.  If no atom exists with the name
  224. \fIname\fR then a new one is created.
  225. .TP
  226. \fBwinfo atomname \fIid\fR
  227. Returns the textual name for the atom whose integer identifier is
  228. \fIid\fR.
  229. This command is the inverse of the \fBwinfo atom\fR command.
  230. Generates an error if no such atom exists.
  231. .TP
  232. \fBwinfo cells \fIwindow\fR
  233. Returns a decimal string giving the number of cells in the
  234. color map for \fIwindow\fR.
  235. .VE
  236. .TP
  237. \fBwinfo children \fIwindow\fR
  238. Returns a list containing the path names of all the children
  239. of \fIwindow\fR.  Top-level windows are returned as children
  240. of their logical parents.
  241. .TP
  242. \fBwinfo class \fIwindow\fR
  243. Returns the class name for \fIwindow\fR.
  244. .TP
  245. \fBwinfo containing \fIrootX rootY\fR
  246. .VS
  247. Returns the path name for the window containing the point given
  248. by \fIrootX\fR and \fIrootY\fR.
  249. \fIRootX\fR and \fIrootY\fR are specified in screen units (i.e.
  250. any form acceptable to \fBTk_GetPixels\fR) in the coordinate
  251. system of the root window (if a virtual-root window manager is in
  252. use then the coordinate system of the virtual root window is used).
  253. If no window in this application contains the point then an empty
  254. string is returned.
  255. In selecting the containing window, children are given higher priority
  256. than parents and among siblings the highest one in the stacking order is
  257. chosen.
  258. .TP
  259. \fBwinfo depth \fIwindow\fR
  260. Returns a decimal string giving the depth of \fIwindow\fR (number
  261. of bits per pixel).
  262. .TP
  263. \fBwinfo exists \fIwindow\fR
  264. Returns 1 if there exists a window named \fIwindow\fR, 0 if no such
  265. window exists.
  266. .TP
  267. \fBwinfo fpixels \fIwindow\fR \fInumber\fR
  268. Returns a floating-point value giving the number of pixels
  269. in \fIwindow\fR corresponding to the distance given by \fInumber\fR.
  270. \fINumber\fR may be specified in any of the forms acceptable
  271. to \fBTk_GetScreenMM\fR, such as ``2.0c'' or ``1i''.
  272. The return value may be fractional;  for an integer value, use
  273. \fBwinfo pixels\fR.
  274. .VE
  275. .TP
  276. \fBwinfo geometry \fIwindow\fR
  277. Returns the geometry for \fIwindow\fR, in the form
  278. \fIwidth\fBx\fIheight\fB+\fIx\fB+\fIy\fR.  All dimensions are
  279. in pixels.
  280. .TP
  281. \fBwinfo height \fIwindow\fR
  282. Returns a decimal string giving \fIwindow\fR's height in pixels.
  283. When a window is first created its height will be 1 pixel;  the
  284. height will eventually be changed by a geometry manager to fulfill
  285. the window's needs.
  286. If you need the true height immediately after creating a widget,
  287. invoke \fBupdate\fR to force the geometry manager to arrange it,
  288. or use \fBwinfo reqheight\fR to get the window's requested height
  289. instead of its actual height.
  290. .TP
  291. \fBwinfo id \fIwindow\fR
  292. Returns a hexadecimal string indicating the X identifier for \fIwindow\fR.
  293. .TP
  294. \fBwinfo interps\fR
  295. Returns a list whose members are the names of all Tcl interpreters
  296. (e.g. all Tk-based applications) currently registered for the
  297. display of the invoking application.
  298. .TP
  299. \fBwinfo ismapped \fIwindow\fR
  300. Returns \fB1\fR if \fIwindow\fR is currently mapped, \fB0\fR otherwise.
  301. .TP
  302. \fBwinfo name \fIwindow\fR
  303. Returns \fIwindow\fR's name (i.e. its name within its parent, as opposed
  304. to its full path name).
  305. .VS
  306. The command \fBwinfo name .\fR will return the name of the application.
  307. .VE
  308. .TP
  309. \fBwinfo parent \fIwindow\fR
  310. Returns the path name of \fIwindow\fR's parent, or an empty string
  311. if \fIwindow\fR is the main window of the application.
  312. .TP
  313. \fBwinfo pathname \fIid\fR
  314. Returns the path name of the window whose X identifier is \fIid\fR.
  315. \fIId\fR must be a decimal, hexadecimal, or octal integer and must
  316. correspond to a window in the invoking application.
  317. .TP
  318. \fBwinfo pixels \fIwindow\fR \fInumber\fR
  319. .VS
  320. Returns the number of pixels in \fIwindow\fR corresponding
  321. to the distance given by \fInumber\fR.
  322. \fINumber\fR may be specified in any of the forms acceptable
  323. to \fBTk_GetPixels\fR, such as ``2.0c'' or ``1i''.
  324. The result is rounded to the nearest integer value;  for a
  325. fractional result, use \fBwinfo fpixels\fR.
  326. .VE
  327. .TP
  328. \fBwinfo reqheight \fIwindow\fR
  329. Returns a decimal string giving \fIwindow\fR's requested height,
  330. in pixels.  This is the value used by \fIwindow\fR's geometry
  331. manager to compute its geometry.
  332. .TP
  333. \fBwinfo reqwidth \fIwindow\fR
  334. Returns a decimal string giving \fIwindow\fR's requested width,
  335. in pixels.  This is the value used by \fIwindow\fR's geometry
  336. manager to compute its geometry.
  337. .TP
  338. \fBwinfo rgb \fIwindow color\fR
  339. .VS
  340. Returns a list containing three decimal values, which are the
  341. red, green, and blue intensities that correspond to \fIcolor\fR in
  342. the window given by \fIwindow\fR.  \fIColor\fR
  343. may be specified in any of the forms acceptable for a color
  344. option.
  345. .VE
  346. .TP
  347. \fBwinfo rootx \fIwindow\fR
  348. Returns a decimal string giving the x-coordinate, in the root
  349. window of the screen, of the
  350. upper-left corner of \fIwindow\fR's border (or \fIwindow\fR if it
  351. has no border).
  352. .TP
  353. \fBwinfo rooty \fIwindow\fR
  354. Returns a decimal string giving the y-coordinate, in the root
  355. window of the screen, of the
  356. upper-left corner of \fIwindow\fR's border (or \fIwindow\fR if it
  357. has no border).
  358. .TP
  359. \fBwinfo screen \fIwindow\fR
  360. Returns the name of the screen associated with \fIwindow\fR, in
  361. the form \fIdisplayName\fR.\fIscreenIndex\fR.
  362. .TP
  363. \fBwinfo screencells \fIwindow\fR
  364. .VS
  365. Returns a decimal string giving the number of cells in the default
  366. color map for \fIwindow\fR's screen.
  367. .TP
  368. \fBwinfo screendepth \fIwindow\fR
  369. Returns a decimal string giving the depth of the root window
  370. of \fIwindow\fR's screen (number of bits per pixel).
  371. .TP
  372. \fBwinfo screenheight \fIwindow\fR
  373. Returns a decimal string giving the height of \fIwindow\fR's screen,
  374. in pixels.
  375. .TP
  376. \fBwinfo screenmmheight \fIwindow\fR
  377. Returns a decimal string giving the height of \fIwindow\fR's screen,
  378. in millimeters.
  379. .TP
  380. \fBwinfo screenmmwidth \fIwindow\fR
  381. Returns a decimal string giving the width of \fIwindow\fR's screen,
  382. in millimeters.
  383. .TP
  384. \fBwinfo screenvisual \fIwindow\fR
  385. Returns one of the following strings to indicate the default visual
  386. type for \fIwindow\fR's screen: \fBdirectcolor\fR, \fBgrayscale\fR,
  387. \fBpseudocolor\fR, \fBstaticcolor\fR, \fBstaticgray\fR, or
  388. \fBtruecolor\fR.
  389. .TP
  390. \fBwinfo screenwidth \fIwindow\fR
  391. Returns a decimal string giving the width of \fIwindow\fR's screen,
  392. in pixels.
  393. .TP
  394. \fBwinfo toplevel \fIwindow\fR
  395. Returns the path name of the top-level window containing \fIwindow\fR.
  396. .TP
  397. \fBwinfo visual \fIwindow\fR
  398. Returns one of the following strings to indicate the visual
  399. type for \fIwindow\fR: \fBdirectcolor\fR, \fBgrayscale\fR,
  400. \fBpseudocolor\fR, \fBstaticcolor\fR, \fBstaticgray\fR, or
  401. \fBtruecolor\fR.
  402. .TP
  403. \fBwinfo vrootheight \fIwindow\fR
  404. Returns the height of the virtual root window associated with \fIwindow\fR
  405. if there is one;  otherwise returns the height of \fIwindow\fR's screen.
  406. .TP
  407. \fBwinfo vrootwidth \fIwindow\fR
  408. Returns the width of the virtual root window associated with \fIwindow\fR
  409. if there is one;  otherwise returns the width of \fIwindow\fR's screen.
  410. .TP
  411. \fBwinfo vrootx \fIwindow\fR
  412. Returns the x-offset of the virtual root window associated with \fIwindow\fR,
  413. relative to the root window of its screen.
  414. This is normally either zero or negative.
  415. Returns 0 if there is no virtual root window for \fIwindow\fR.
  416. .TP
  417. \fBwinfo vrooty \fIwindow\fR
  418. Returns the y-offset of the virtual root window associated with \fIwindow\fR,
  419. relative to the root window of its screen.
  420. This is normally either zero or negative.
  421. Returns 0 if there is no virtual root window for \fIwindow\fR.
  422. .VE
  423. .TP
  424. \fBwinfo width \fIwindow\fR
  425. Returns a decimal string giving \fIwindow\fR's width in pixels.
  426. When a window is first created its width will be 1 pixel;  the
  427. width will eventually be changed by a geometry manager to fulfill
  428. the window's needs.
  429. If you need the true width immediately after creating a widget,
  430. invoke \fBupdate\fR to force the geometry manager to arrange it,
  431. or use \fBwinfo reqwidth\fR to get the window's requested width
  432. instead of its actual width.
  433. .TP
  434. \fBwinfo x \fIwindow\fR
  435. Returns a decimal string giving the x-coordinate, in \fIwindow\fR's
  436. parent, of the
  437. upper-left corner of \fIwindow\fR's border (or \fIwindow\fR if it
  438. has no border).
  439. .TP
  440. \fBwinfo y \fIwindow\fR
  441. Returns a decimal string giving the y-coordinate, in \fIwindow\fR's
  442. parent, of the
  443. upper-left corner of \fIwindow\fR's border (or \fIwindow\fR if it
  444. has no border).
  445.  
  446. .SH KEYWORDS
  447. atom, children, class, geometry, height, identifier, information, interpreters,
  448. mapped, parent, path name, screen, virtual root, width, window
  449.